<?php

namespace app\common\model\mysql;


use think\Collection;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\Exception;
use think\Model;

class SystemTitles extends BaseModel
{
    protected $schema=[
        'id'=>'int',
        'series_id'=>'int',
        'level_id'=>'int',
        'name'=>'varchar',
        'create_time'=>'int',
        'update_time'=>'int',
        'status'=>'tinyint'
    ];

    /**
     * 获取列表
     * @param $where
     * @param $field
     * @return array
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function getList($where,$field): array
    {
        $data=$this->where($where)->field($field)->select();
        return $data->isEmpty()?[]:$data->toArray();
    }
}
